-
Notifications
You must be signed in to change notification settings - Fork 3.3k
improvement(billing): duplicate checks for bypasses, logger billing actor consistency, run from block #3107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR strengthens billing integrity by adding duplicate subscription checks, ensuring billing actor consistency, and extending billing enforcement to run-from-block executions. Key Changes
Architecture ImpactThe changes consolidate billing logic into reusable helpers and ensure consistent billing actor resolution across execution paths. The duplicate subscription checks create multiple defense layers at authorization, checkout, transfer, and organization creation points. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant ExecuteAPI as Execute-from-Block API
participant Preprocessing as preprocessExecution
participant Billing as Billing Module
participant Logger as ExecutionLogger
participant DB as Database
Client->>ExecuteAPI: POST /workflows/{id}/execute-from-block
ExecuteAPI->>Preprocessing: Check billing & limits
Preprocessing->>DB: Fetch workflow record
DB-->>Preprocessing: Workflow details
Preprocessing->>Billing: Get workspace billed account
Billing-->>Preprocessing: actorUserId
Preprocessing->>Billing: Check usage limits
Billing-->>Preprocessing: Usage check result
alt Usage exceeded or blocked
Preprocessing-->>ExecuteAPI: Error (402/403)
ExecuteAPI-->>Client: Execution blocked
else Checks passed
Preprocessing-->>ExecuteAPI: Success with actorUserId
ExecuteAPI->>ExecuteAPI: Execute workflow
ExecuteAPI->>Logger: Log execution with costs
Logger->>Billing: Get workspace billed account
Billing-->>Logger: billingUserId
Logger->>DB: Update userStats (billing actor)
DB-->>Logger: Updated
Logger-->>ExecuteAPI: Logged
ExecuteAPI-->>Client: Execution result
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 files reviewed, no comments
|
@cursor review |
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Summary
Type of Change
Testing
Tested manually
Checklist